Optimal. Leaf size=203 \[ -\frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \log \left (1-\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {2 B n \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \text {Li}_2\left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {2 B^2 n^2 \text {Li}_3\left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.34, antiderivative size = 203, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 51, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.137, Rules used = {2573, 2576, 3,
1607, 2379, 2421, 6724} \begin {gather*} \frac {2 B n \text {PolyLog}\left (2,\frac {(c+d x) (b f-a g)}{(a+b x) (d f-c g)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{h (b f-a g)}+\frac {2 B^2 n^2 \text {PolyLog}\left (3,\frac {(c+d x) (b f-a g)}{(a+b x) (d f-c g)}\right )}{h (b f-a g)}-\frac {\log \left (1-\frac {(c+d x) (b f-a g)}{(a+b x) (d f-c g)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{h (b f-a g)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3
Rule 1607
Rule 2379
Rule 2421
Rule 2573
Rule 2576
Rule 6724
Rubi steps
\begin {align*} \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{a f h+b g h x^2+h (b f x+a g x)} \, dx &=\int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{h (a+b x) (f+g x)} \, dx\\ &=\frac {\int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{(a+b x) (f+g x)} \, dx}{h}\\ &=\frac {\int \left (\frac {A^2}{(a+b x) (f+g x)}+\frac {2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (f+g x)}+\frac {B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (f+g x)}\right ) \, dx}{h}\\ &=\frac {A^2 \int \frac {1}{(a+b x) (f+g x)} \, dx}{h}+\frac {(2 A B) \int \frac {\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (f+g x)} \, dx}{h}+\frac {B^2 \int \frac {\log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (f+g x)} \, dx}{h}\\ &=-\frac {2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}-\frac {B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {\left (A^2 b\right ) \int \frac {1}{a+b x} \, dx}{(b f-a g) h}-\frac {\left (A^2 g\right ) \int \frac {1}{f+g x} \, dx}{(b f-a g) h}+\frac {(2 A B (b c-a d) n) \int \frac {\log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(a+b x) (c+d x)} \, dx}{(b f-a g) h}+\frac {\left (2 B^2 (b c-a d) n\right ) \int \frac {\log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(a+b x) (c+d x)} \, dx}{(b f-a g) h}\\ &=\frac {A^2 \log (a+b x)}{(b f-a g) h}-\frac {A^2 \log (f+g x)}{(b f-a g) h}-\frac {2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}-\frac {B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text {Li}_2\left (1+\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}-\frac {(2 A B (b c-a d) n) \text {Subst}\left (\int \frac {\log \left (-\frac {(b c-a d) x}{d f-c g}\right )}{1+\frac {(b c-a d) x}{d f-c g}} \, dx,x,\frac {f+g x}{a+b x}\right )}{(b f-a g) (d f-c g) h}-\frac {\left (2 B^2 (b c-a d) n^2\right ) \int \frac {\text {Li}_2\left (1+\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(a+b x) (c+d x)} \, dx}{(b f-a g) h}\\ &=\frac {A^2 \log (a+b x)}{(b f-a g) h}-\frac {A^2 \log (f+g x)}{(b f-a g) h}-\frac {2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}-\frac {B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right ) \log \left (-\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {2 A B n \text {Li}_2\left (1+\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {2 B^2 n \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \text {Li}_2\left (1+\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {2 B^2 n^2 \text {Li}_3\left (1+\frac {(b c-a d) (f+g x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1415\) vs. \(2(203)=406\).
time = 0.40, size = 1415, normalized size = 6.97 \begin {gather*} \frac {3 \log (a+b x) \left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right )^2-3 \left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right )^2 \log (f+g x)+3 B n \left (A+B \left (-n \log (a+b x)+n \log (c+d x)+\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right ) \left (\log ^2(a+b x)-2 \left (\log (a+b x) \log \left (\frac {b (f+g x)}{b f-a g}\right )+\text {Li}_2\left (\frac {g (a+b x)}{-b f+a g}\right )\right )\right )-6 A B n \left (\log (c+d x) \left (\log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log \left (\frac {d (f+g x)}{d f-c g}\right )\right )+\text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )-\text {Li}_2\left (\frac {g (c+d x)}{-d f+c g}\right )\right )+6 B^2 n \left (n \log (a+b x)-n \log (c+d x)-\log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \left (\log (c+d x) \left (\log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log \left (\frac {d (f+g x)}{d f-c g}\right )\right )+\text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )-\text {Li}_2\left (\frac {g (c+d x)}{-d f+c g}\right )\right )+B^2 n^2 \left (\log ^2(a+b x) \left (\log (a+b x)-3 \log \left (\frac {b (f+g x)}{b f-a g}\right )\right )-6 \log (a+b x) \text {Li}_2\left (\frac {g (a+b x)}{-b f+a g}\right )+6 \text {Li}_3\left (\frac {g (a+b x)}{-b f+a g}\right )\right )+3 B^2 n^2 \left (\log \left (\frac {d (a+b x)}{-b c+a d}\right ) \log ^2(c+d x)-\log ^2(c+d x) \log \left (\frac {d (f+g x)}{d f-c g}\right )+2 \log (c+d x) \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )-2 \log (c+d x) \text {Li}_2\left (\frac {g (c+d x)}{-d f+c g}\right )-2 \text {Li}_3\left (\frac {b (c+d x)}{b c-a d}\right )+2 \text {Li}_3\left (\frac {g (c+d x)}{-d f+c g}\right )\right )-6 B^2 n^2 \left (\frac {1}{2} \log ^2(a+b x) \left (\log (c+d x)-\log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-\log (a+b x) \log (c+d x) \log \left (\frac {b (f+g x)}{b f-a g}\right )-\frac {1}{2} \log \left (\frac {g (c+d x)}{-d f+c g}\right ) \left (-2 \log (a+b x)+\log \left (\frac {g (c+d x)}{-d f+c g}\right )\right ) \left (\log \left (\frac {b (f+g x)}{b f-a g}\right )-\log \left (\frac {d (f+g x)}{d f-c g}\right )\right )+\log \left (\frac {g (c+d x)}{-d f+c g}\right ) \log \left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right ) \left (\log \left (\frac {b (f+g x)}{b f-a g}\right )-\log \left (\frac {d (f+g x)}{d f-c g}\right )\right )-\frac {1}{2} \log ^2\left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right ) \left (\log \left (\frac {-b c+a d}{d (a+b x)}\right )+\log \left (\frac {b (f+g x)}{b f-a g}\right )-\log \left (\frac {(-b c+a d) (f+g x)}{(d f-c g) (a+b x)}\right )\right )-\log (a+b x) \text {Li}_2\left (\frac {d (a+b x)}{-b c+a d}\right )-\left (\log (c+d x)-\log \left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )\right ) \text {Li}_2\left (\frac {g (a+b x)}{-b f+a g}\right )-\left (\log (a+b x)+\log \left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )\right ) \text {Li}_2\left (\frac {g (c+d x)}{-d f+c g}\right )-\log \left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right ) \left (\text {Li}_2\left (\frac {b (c+d x)}{d (a+b x)}\right )-\text {Li}_2\left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )\right )+\text {Li}_3\left (\frac {d (a+b x)}{-b c+a d}\right )+\text {Li}_3\left (\frac {g (a+b x)}{-b f+a g}\right )+\text {Li}_3\left (\frac {g (c+d x)}{-d f+c g}\right )+\text {Li}_3\left (\frac {b (c+d x)}{d (a+b x)}\right )-\text {Li}_3\left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )\right )}{3 (b f-a g) h} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.55, size = 0, normalized size = 0.00 \[\int \frac {\left (A +B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right )\right )^{2}}{a f h +b g h \,x^{2}+h \left (a g x +b f x \right )}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (A+B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\right )}^2}{h\,\left (a\,g\,x+b\,f\,x\right )+a\,f\,h+b\,g\,h\,x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________